Jupyter at Bryn Mawr College |
|||
Public notebooks: /services/public/dblank / jupyter.cs |
Welcome to the Jupyter Project at Bryn Mawr College. Jupyter is an interface to write executable documents, reproducible research, documents with visualizations, and just explore computation.
You can log into Jupyter here: http://jupyter.cs.brynmawr.edu
Below you will find some help on getting started with Jupyter at Bryn Mawr College.
from calico.password import change_password
A new password should have numbers and letters, composed of more than just dictionary words, and be of sufficient length. It may take more than one try to create a good password:
change_password()
First, make a folder in your root directory:
! mkdir ~/Public
Next, make it readable by all:
! chmod a+r ~/Public
Finally, make the readability "sticky" so that all files created here will be readable by all:
! chmod g+s ~/Public
Currently there is a bug in Jupyter: if you open and re-save your Public notebook, you'll have to reset the permissions. See issue #6405.
! mkdir ~/Incoming
! chmod a+w ~/Incoming
! mkdir -p ~/.ipython/kernels/calico_scheme_kernel
%%file ~/.ipython/kernels/calico_scheme_kernel/kernel.json
{
"argv": ["/usr/bin/python",
"-m", "calico_scheme_kernel",
"-f", "{connection_file}"],
"display_name": "Scheme",
"language": "scheme"
}
! mkdir -p ~/.ipython/kernels/python3
%%file ~/.ipython/kernels/python3/kernel.json
{
"display_name": "IPython (Python 3)",
"language": "python",
"argv": [
"python3",
"-c", "from IPython.kernel.zmq.kernelapp import main; main()",
"-f", "{connection_file}"
],
"codemirror_mode": {
"version": 2,
"name": "ipython"
}
}
! git clone https://bitbucket.org/ipre/calico.git ~/Calico
! cp ~/Calico/bin/linux/clrzmq.dll ~/Calico/bin/
! mkdir -p ~/.ipython/kernels/calico
Replace USER below with your user id:
%%file ~/.ipython/kernels/calico/kernel.json
{
"argv": ["/usr/bin/mono",
"/home/USER/Calico/bin/Calico.exe",
"--nographics",
"--server", "{connection_file}"],
"display_name": "Calico",
"language": "python"
}
! julia -e "Pkg.add(\"IJulia\")"
Replace USER with your user id:
%%file ~/.ipython/kernels/julia/kernel.json
{
"display_name": "Julia",
"language": "julia",
"argv": ["/usr/bin/julia-basic",
"-F", "/home/USER/.julia/v0.2/IJulia/src/kernel.jl", "{connection_file}"
]
}
FIXME: add details
There are three collections of Calico notebook extensions that you might be interested in using. Below you can see demonstrations and installation instructions.
The Calico Spell Check extension checks the spelling of words in Markdown and Heading cells as you type. It is very fast, and expands to about 700k after download.
Demonstration of use:
import IPython
IPython.display.YouTubeVideo("Km3AtRynWFQ")
!ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip
The Calico Document Tools extensions adds section moving, heading numbering, table of contents, and bibliography support.
Demonstration of use:
IPython.display.YouTubeVideo("YbM8rrj-Bms")
!ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-document-tools-1.0.zip
The Calico Cell Tools extension adds tabbed Input/Output views to individual code cells, and two columns to individual cells.
Demonstration of use:
IPython.display.YouTubeVideo("WwoTzvOkEJQ")
!ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-cell-tools-1.0.zip
You could load these in just this notebook with the following:
%%javascript
IPython.load_extensions('calico-spell-check', 'calico-document-tools', 'calico-cell-tools');
Or, you could add these to your custom.js file so that they will be loaded always:
%%file ~/.ipython/profile_default/static/custom/custom.js
require(["base/js/events"], function (events) {
events.on("app_initialized.NotebookApp", function () {
IPython.load_extensions('calico-spell-check', 'calico-document-tools', 'calico-cell-tools');
// To turn off automatically creating closing parenthesis and bracket:
IPython.CodeCell.options_default.cm_config["autoCloseBrackets"] = "";
});
});
Some resources for learning about how to edit Jupyter Notebooks:
Some good resources on learning Python in notebooks: